﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAO;
using DTO;

namespace BUS
{
    public class ThanhPham_BUS
    {
        private ThanhPham_DAO data = new ThanhPham_DAO();
        public DataTable GetCmbLoaiTP()
        {
            return data.GetCmbLoaiTP();
        }
        public DataTable GetDanhSachTP()
        {
            return data.GetDanhSachTP();
        }
       
       
        public void SuaThanhPham(ThanhPham_DTO ThanhPham)
        {
            data.SuaThanhPham(ThanhPham);
        }
        public DataTable GetDanhSachTPTheoXe(int MaXe)
        {
            return data.GetDanhSachTPTheoXe(MaXe);
        }
        public void ThemCT_ThanhPham(ThanhPham_DTO TP)
        {
            data.ThemCT_ThanhPham(TP);
        }
        public DataTable GetDanhSachCT_ThanhPham(DateTime NgayTao)
        {
            return data.GetDanhSachCT_ThanhPham(NgayTao);
        }
        public void Tang_SoLuongThanhPham(float SL_TP, string MaTP)
        {
            data.Tang_SoLuongThanhPham(SL_TP, MaTP);
        }
        //Upadte khi tang so luong thanh pham
        public void Pro_Update_NLG(string MaNLG, string MaTP, float SoLuongTuManHinh)
        {
            data.Pro_Update_NLG(MaNLG, MaTP, SoLuongTuManHinh);
        }
        public DataTable CT_ThanhPham(string MaTP)
        {
            return data.CT_ThanhPham(MaTP);
        }
        ////Thong Tin Nguyên liệu của thành phẩm
        //public void Them_ThongTinNLCuaTP(CT_SX_ThanhPham_DTO dto)
        //{
        //    data.Them_ThongTinNLCuaTP(dto);
        //}
        public DataTable Get_ThongTinNLCuaTP(string MaTP)
        {
            return data.Get_ThongTinNLCuaTP(MaTP);
        }
        //=============
        public int proc_Ins_ThanhPham(ThanhPham_DTO dto)
        {
            return data.proc_Ins_ThanhPham(dto); ;
        }
        public void proc_Ins_SoLuongThanhPhamMoiNgay(ThanhPham_DTO dto)
        {
             data.proc_Ins_SoLuongThanhPhamMoiNgay(dto);
        }
        public DataTable GetDanhSachTPTheoMaLoaiTP(int MaLoaiTP)
        {
            return data.GetDanhSachTPTheoMaLoaiTP(MaLoaiTP);
        }
        public DataTable GetDanhSachNL()
        {
            return data.GetDanhSachNL();
        }
    }
}
